﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Controls.Primitives;
using System.Collections.ObjectModel;
using System.Windows.Automation;
using System.Windows.Automation.Peers;
using System.Windows.Automation.Provider;
using System.ComponentModel;

namespace TeamResourceManageAssist
{
	public partial class ProjectInfoController : UserControl
	{
		public ProjectInfoController()
		{
			// Required to initialize variables
			InitializeComponent();
		}

        private void ScrollBar1_Scroll(object sender, System.Windows.Controls.Primitives.ScrollEventArgs e)
        {
            ScrollBar scrollBar = (ScrollBar)sender;
            int CurrentIndex = Convert.ToInt32(24 * e.NewValue / (scrollBar.Maximum - scrollBar.Minimum));
            if (CurrentIndex >= 0 && CurrentIndex <= 24)
            {
                DataGrid1.SelectedIndex = CurrentIndex - 1;
                DataGrid1.ScrollIntoView(DataGrid1.SelectedItem, null);
                DataGrid2.ScrollIntoView(DataGrid1.SelectedItem, null);
            }
        }

	}
}